CC=/usr/local/bin/arm-apple-darwin-gcc -v
CXX=/usr/local/bin/arm-apple-darwin-g++

LD=$(CC)
LDFLAGS = -framework CoreFoundation \
          -framework Foundation \
          -framework UIKit \
          -framework LayerKit \
          -framework CoreGraphics \
          -framework GraphicsServices \
          -framework CoreSurface \
          -lobjc

UI_OBJS = source/ui/main.o source/ui/iTalyView.o source/model/Phrase.o

all:	package

iTaly: $(UI_OBJS)
	$(LD) $(LDFLAGS) -o $@ $^

%.o:	%.m
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

package: iTaly
	rm -fr bin
	mkdir -p bin/iTally.app
	cp -r ./resources/package/*.* ./bin/iTally.app
	mv iTaly ./bin/iTally.app

clean:	
	rm -f source/ui/*.o iTally
	rm -rf ./bin
